home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-09-27 | 16.0 KB | 233 lines | [TEXT/PJMM] |
- {This is what is new in the last couple of versions of Hermes Toolbox}
-
- unit WhatsNew;
-
- interface
-
- {•••••••••••••••••••••••••••New in verion 1.0•••••••••••••••••••••••••••••}
-
- function OpenDebugFile (HermSetup: UserXIPtr): integer;
- {-----------------------------------------------------------------------------------}
- {This function is just intended to make setting up a debugging file a little easier. Calling it}
- {will open (or create) a file calle "Debug File" inside your Hermes Files folder. It also stamps}
- {the time and date when it was opened to the file. It returns a integer which is the file}
- {reference number or 0 if it wasn't able to open the file. Save this number in your privates}
- {so you can write to the file and later to close it.}
- {-----------------------------------------------------------------------------------}
-
- procedure WriteDebugFile (theString: str255; debugRefNum: integer);
- {-----------------------------------------------------------------------------------}
- {Once again this is to simplify the logging of errors. Pass it the refNum created by your}
- {call to "Open DebugFile" along with the string you want recorded and it will write it to the}
- {Debug file. A return is automatically added to the end of the string. There is no error}
- {checking here but for just testing that is probably preferable.}
- {-----------------------------------------------------------------------------------}
-
- procedure CloseDebugFile (debugRefNum: integer);
- {-----------------------------------------------------------------------------------}
- {This procedure will close the file created by "OpenDebugFile". Pass it the refNum created}
- {by that procedure.}
- {-----------------------------------------------------------------------------------}
-
- procedure DebugString (theStr: str255; waitForReply: boolean);
- {-----------------------------------------------------------------------------------}
- {This procedure is great for debugging. It requires that you have an freeware application}
- {called "Debug Window". Pass a debugging string in theStr and this will send an AppleEvent}
- {to Debug Window that will log that string to the text window of "Debug Window". This does}
- {not add a return to the end of the string but Debug Window has an option to automatically add}
- {them to each string that is sent. The waitForReply variable determines whether it should}
- {wait for Debug Window to reply. If true it will wait (up to 5 seconds) for a reply. The}
- {advantage of waiting for a reply is that strings appear in the Debug Window one at a time}
- {as they are sent out. That way you can watch both the Hermes window and Debug Window}
- {and see your debugging strings at the same time that event is taking place in Hermes. If you}
- {don't wait for a reply the stings will tend to bunch up and it won't always be apparent at}
- {what stage they generated in Hermes. The disadvantage to waiting for a reply is that it}
- {slows Hermes down some. Since you will only use this for debugging this is probably}
- {acceptable but you have the option to no wait. This procedure requires System 7 of course.}
- {***Note*** As with all debugging procedures, don't forget to take these out before you}
- {ship your external. You can't tell its there but you don't want it there in your finished}
- {external.}
- {-----------------------------------------------------------------------------------}
-
- procedure DebugTimestamp (waitForReply: boolean);
- {-----------------------------------------------------------------------------------}
- {This procedure will cause Debug Window to stamp the time and date in the Debug Window.}
- {See DebugString for details.}
- {-----------------------------------------------------------------------------------}
-
- procedure DebugClearWindow (waitForReply: boolean);
- {-----------------------------------------------------------------------------------}
- {This procedure will clear the window in Debug Window. See DebugString for details.}
- {-----------------------------------------------------------------------------------}
-
- {•••••••••••••••••••••••••••New in verion 0.9•••••••••••••••••••••••••••••}
-
- function CheckRegistration (bbsName: str255; registrationNum: longInt; regNum1, regNum2: longint): boolean;
- {-----------------------------------------------------------------------------------}
- {This procedure will check a registration number for a given BBS name. It returns true if the}
- {registration number is valid and false if it is invalid. This relies on regNum1 and regNum2 }
- {regNum1 should be a 6 digit number and regNum2 should be a 3 digit number. These numbers}
- {should be changed for each external. You must use the same numbers that you used when you}
- {created the number with CreateRegistration though.}
- {-----------------------------------------------------------------------------------}
-
- function CreateRegistration (bbsName: str255; regNum1, regNum2: longint): longint;
- {-----------------------------------------------------------------------------------}
- {This procedure will return a registration number for the bbsName you pass it. It also relies}
- {on regNum1 and regNum2 (see above). You can use this is a small application or external}
- {that creates registration numbers. You should define these two numbers as constants and}
- {use the same ones to create and then check registration numbers.}
- {-----------------------------------------------------------------------------------}
-
- {•••••••••••••••••••••••••••New in verion 0.8•••••••••••••••••••••••••••••}
-
- procedure DoTimeDialog (var hour, minute: integer);
- {-----------------------------------------------------------------------------------}
- {This procedure puts up a dialog similar to that which Hermes uses to enter the time for node}
- {start and end time. It gives the sysop the opportunity to enter time in a manner similar to}
- {that used by the Alarm Clock DA and General control panel. It returns the hour and minute}
- {that the sysop entered. The hour is in 24 hour format so 0 is midnight and 23 is 11 pm.}
- {Note that this dialog is modal so it will stop other action on the BBS, but this isn't really a}
- {problem since the sysop will use it rarely. If you use this function you MUST include all}
- {the resources included in the file with the same name as this function. Use ResEdit to copy}
- {them to your external's resource file. There is a text item in this dialog which can be used}
- {to prompt the user. You can either change it with ResEdit or call ParamText and set string}
- {number 0 to what you want displayed in that item.}
- {-----------------------------------------------------------------------------------}
-
- function StuffitExists: boolean;
- {-----------------------------------------------------------------------------------}
- {This function will check for the existence of the Stuffit Engine. The Stuffit Engine is}
- {supposed to be kept in the Extensions folder inside the System Folder. It returns true if the}
- {Engine is found and false if not. Most of the other Stuffit Functions call this one but you}
- {should still check before using any of them so you can report back to the user.}
- {-----------------------------------------------------------------------------------}
-
- function StuffFile (source, destination: str255; deleteOriginal: boolean): OSErr;
- {-----------------------------------------------------------------------------------}
- {This function will compress a single file using the Stuffit Engine which is part of the Stuffit}
- {Deluxe package. You should pass the path to the file to be compressed in source and where}
- {you want the archive to be placed in destination. If deleteOriginal is true then the file will}
- {be deleted after it has been compressed. This function does not add .sit to the end of the}
- {file name so if you are putting the new archive in the same directory you will need to add}
- {it yourself in the destination name. The fuction returns any OSErr that might take place}
- {and returns -1 if the user cancels the operation by hitting the stop button in the Stuffit}
- {Engine dialog. Although this function calls StuffitExists you should before calling it in order}
- {to report any errors to the user.}
- {-----------------------------------------------------------------------------------}
-
- function TouchFolder (folderPath: str255): OSErr;
- {-----------------------------------------------------------------------------------}
- {This procedure will chage the last modified date of a folder to the current time and date.}
- {This is often useful because it forces the Finder to update all the files in that folder. Pass}
- {it the path to the folder you want to change and it will return any error.}
- {-----------------------------------------------------------------------------------}
-
- procedure FlushAllVolumes;
- {-----------------------------------------------------------------------------------}
- {This procdure will cause all mounted volumes to be immeadiately flushed. All changes that}
- {have been made to files will be written to disk. This is important because the mac doesn't}
- {write to disk until the buffer is full. If you want to do something especially dangerous or}
- {something like shutdown the machine it might be a good idea to call this first.}
- {-----------------------------------------------------------------------------------}
-
- {•••••••••••••••••••••••••••New in verion 0.7•••••••••••••••••••••••••••••}
-
- function FindUserOnline (userNum: integer; var node: integer; HermSetup: UserXIPtr): boolean;
- {-----------------------------------------------------------------------------------}
- {This function will return true if the user specified by userNum is online. If true then the}
- {node that user is on will be returned in node.}
- {-----------------------------------------------------------------------------------}
-
- function NewUserAccount (var newUser: UserRec; HermSetup: UserXIPtr): OSErr;
- {-----------------------------------------------------------------------------------}
- {This function will create a new user on the BBS. You can pass a full user record or use}
- {WriteUser to flesh it out later. The new user's user number will be passed back in}
- {newUser.userNum.}
- {-----------------------------------------------------------------------------------}
-
- procedure CenterDialog (theDialog: DialogPtr);
- {-----------------------------------------------------------------------------------}
- {This procedure takes a dialog (or window) pointer (which you would get from GetNewDialog)}
- {and centers it on the screen. You should make your dialog 'initially invisable' and call this}
- {procedure BEFORE calling ShowWindow. Otherwise the user will see the dialog move across}
- {the screen.}
- {-----------------------------------------------------------------------------------}
-
- function DoRegistrationDialog (var bbsName: str255; var registrationNum: longInt): boolean;
- {-----------------------------------------------------------------------------------}
- {This function will put up a small dialog that will allow the sysop to enter basic registration}
- {information. The dialog has two items, one for a BBS name and one for a registration}
- {number. The function stores these two values in bbsName and registrationNum. The dialog}
- {also has two buttons, one for OK and one for cancel. The function will return true if the OK}
- {buttun is hit and false if cancel is hit. Note that this dialog is modal so it will stop other}
- {action on the BBS, but this isn't really a problem since the sysop will use it rarely. If you}
- {use this function you MUST include all the resources included in the file with the same name}
- {as this function. Use ResEdit to copy them to your external's resource file.}
- {-----------------------------------------------------------------------------------}
-
- function GetRegistration (var bbsName: str255; var registrationNum: longInt; resourceName: resType): boolean;
- {-----------------------------------------------------------------------------------}
- {This function will let you get saved registration information. It will retrieve the registration}
- {information in bbsName and registration number. You must pass the resourceName that you}
- {previously used to save the information. See SetRegistration for details. It will return true}
- {if it found the resource and false if it did not. If it did not find the resource you can create a}
- {new one by calling SetRegistration.}
- {-----------------------------------------------------------------------------------}
-
- procedure SetRegistration (bbsName: str255; registrationNum: longInt; resourceName: resType);
- {-----------------------------------------------------------------------------------}
- {This procedure will let you save registration information in your external's resource fork.}
- {Pass it the bbsName and registrationNum you want to save. You also need to pass a}
- {resource type name. This simply 4 letters (ie HRMS). Each external you write should have}
- {its own type though to avoid possible conflicts. Use the same type you use here as in}
- {GetRegistration.}
- {-----------------------------------------------------------------------------------}
-
- {•••••••••••••••••••••••••••New in verion 0.6•••••••••••••••••••••••••••••}
-
- function FindAndReplace (theString: Str255; oldString, newString: Str255): str255;
- {-----------------------------------------------------------------------------------}
- {This function takes theString and replaces the first occurance of oldString with newString}
- {and returns the resulting string.}
- {-----------------------------------------------------------------------------------}
-
- function FindAndReplaceAll (theString: Str255; oldString, newString: Str255): str255;
- {-----------------------------------------------------------------------------------}
- {This function takes theString and replaces the all occurances of oldString with newString}
- {and returns the resulting string.}
- {-----------------------------------------------------------------------------------}
-
- function CheckCard (cardNum: str255; visa, master, amex, discover: boolean): boolean;
- {-----------------------------------------------------------------------------------}
- {Yea, yea this is getting strange but I needed it so why not make it avaliable. This function}
- {will take a string representing a credit card number and will determine if the number is in}
- {the valid format. Pass true in the remaining varialbes for each type of credit card that is}
- {acceptable. In other words if you pass false for a varialbe that card type will not be }
- {considered valid. The cardNum string can have spaces although they are not necessary.}
- {All spaces will be ignored when evaluating the number. This function does three things.}
- {First, it checks the first number of the card for the credit card type and sees if that type}
- {is accepted. Second, it makes sure that the number is of the proper number of digits for}
- {each type. Third , it does a checksum on the number to see if it is a possible credit card}
- {number. This checksum is fairly involved and is not something you would want to do in}
- {your head but it is a good way to check cards. A number which passes these checks is}
- {not necessarily valid (ie it may not be assigned to anyone, stolen etc) but this is a good way}
- {to screen out fake numbers and mistakes.}
- {-----------------------------------------------------------------------------------}
-
- function CheckExpiration (expirationDate: str255): boolean;
- {-----------------------------------------------------------------------------------}
- {This function will take an expiration date (in the form MM/YY) and return whether this date}
- {has passed yet. With this and CheckCard, assuming the information is given truthfully, you}
- {can confirm the validity of a credit card immeadiately.}
- {-----------------------------------------------------------------------------------}
-
- procedure SetMouse (newPoint: Point);
- {-----------------------------------------------------------------------------------}
- {This procedure will set the cursor to newPoint. Why you would want to do this is beyond me}
- {but I had a reason to do so (the user doesn't ever notice). This is a really rude thing to do}
- {and is a good way to have an program which flops (people hate the mouse moving on them)}
- {-----------------------------------------------------------------------------------}
-
- implementation
- end.